﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.MdProduct.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.MdProduct;
/// <summary>
/// 获取体验产品列表服务
/// </summary>
public class GetMdProductExperienceListService : ApiBase<RequestGetMdProductExperienceListModel>
{
    /// <summary>
    /// 产品仓储
    /// </summary>
    public MdProductRep mdProductRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new MdProductModel();

        model.ProductExperienceId = Parameter.ProductExperienceId;
        model.Title = Parameter.Title;
        model.Category = Parameter.Category;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = mdProductRep.GetMdProductExperienceList(model, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}
